<template>
  <nav>
    <router-link to="/about">About</router-link>
    <button v-track="['营销', '新增优惠券']">点击出发呀</button>
  </nav>
  <router-view />
</template>

<script setup>
import { getCurrentInstance } from "vue";
const internalInstance = getCurrentInstance();
import {
  Analytics,
  trackDirective,
} from "../../../packages/analytics/index.js";
const url = "//v1.cnzz.com/z.js?id=xxxxxx&async=1";
internalInstance.appContext.app.use(Analytics, url).use(trackDirective);
// internalInstance.appContext.app.use(trackDirective);
console.log("~internalInstance~~", internalInstance);
</script>
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}
</style>
